package com.bachongLightNovel.system.mapper;

import com.bachongLightNovel.model.pojo.system.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SystemRoleMapper {

    //查询所有数据
    @Select("select * from role")
    List<Role> selectAll();

    //将数据插入到数据库当中
    @Insert("insert into role(name, description)" +
            "values (#{name},#{description})")
    void insert(Role role);

    //根据id修改角色信息
    void update(Role role);

    //根据id删除数据
    @Delete("delete from role where id=#{id};")
    void deleteById(Long id);
}
